package com.example.excelimporter.model;

import lombok.Data;

import javax.persistence.*;
import java.util.List;

@Data
@Entity
@Table(name = "template_configs")
public class TemplateConfig {
    @Id
    private String id;

    @Column(nullable = false)
    private String templateName;

    @Column(columnDefinition = "TEXT")
    private String description;

    @Column(nullable = false)
    private String targetTable;

    @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
    @JoinColumn(name = "template_id")
    private List<FieldConfig> fieldConfigs;

    @Transient
    private Class<?> dataClass;
}
